Python 3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help.

In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'loadingRatePAEffect2')
data = []
for rel_path in os.listdir(MEASURE_FOLDER):
    run_path = os.path.join(MEASURE_FOLDER, rel_path)
    filename = os.path.join(run_path, 'data.csv')
    settingsname = os.path.join(run_path, 'Settings.txt')
    try:
        dh1 = MTdataHost(SAMPLE_RATE)
        dh1.loadCATdata(fileName=filename, settingsName=settingsname)
        dh1.timeDeload=0
        dh1.timeReload=0
        dh1.setCATtiming()
        dh1.tLoad = dh1.tLoad - dh1.timeBaseline
        dh1.tBaseline = dh1.tBaseline - dh1.timeBaseline
        dh1.setBaseline(0.002)
        dh1.setLoading(0.002)
        dh1.motR=0.1
        initFit, initX = dh1.setInitialLoad(0.01)

        ind1 = int(dh1.initTime[0]*2000)
        ind2 = ind1 + len(dh1.initTime)
        plt.plot(dh1.initTime, dh1.voltage[ind1:ind2+1][:len(dh1.initTime)])
        plt.plot(dh1.initTime, initFit[2])
        plt.title(f'Loading Rate = {dh1.initMOTR:.2e},  MOT SS = {dh1.motSS:.2e}')
        plt.show()
        plt.close()
        data.append({'R':dh1.initMOTR, 'MOTSS':dh1.motSS})
    except Exception:
        pass
data = pd.DataFrame(data)
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'loadingRatePAEffect2')
data = []
for rel_path in os.listdir(MEASURE_FOLDER):
    run_path = os.path.join(MEASURE_FOLDER, rel_path)
    filename = os.path.join(run_path, 'data.csv')
    settingsname = os.path.join(run_path, 'Settings.txt')
    try:
        dh1 = MTdataHost(SAMPLE_RATE)
        dh1.loadCATdata(fileName=filename, settingsName=settingsname)
        dh1.timeDeload=0
        dh1.timeReload=0
        dh1.setCATtiming()
        dh1.tLoad = dh1.tLoad - dh1.timeBaseline
        dh1.tBaseline = dh1.tBaseline - dh1.timeBaseline
        dh1.setBaseline(0.002)
        dh1.setLoading(0.002)
        initFit, initX = dh1.setInitialLoad(0.01)

        ind1 = int(dh1.initTime[0]*2000)
        ind2 = ind1 + len(dh1.initTime)
        plt.plot(dh1.initTime, dh1.voltage[ind1:ind2+1][:len(dh1.initTime)])
        plt.plot(dh1.initTime, initFit[2])
        plt.title(f'Loading Rate = {dh1.initMOTR:.2e},  MOT SS = {dh1.motSS:.2e}')
        plt.show()
        plt.close()
        data.append({'R':dh1.initMOTR, 'MOTSS':dh1.motSS})
    except Exception:
        pass
data = pd.DataFrame(data)
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
In [ ]:
data
Out[ ]:
R MOTSS
0 0.019687 0.142943
1 0.018433 0.160811
2 0.018179 0.172178
3 0.018500 0.146471
4 0.010104 0.072018
5 0.008487 0.101331
6 0.009577 0.081486
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'loadingRatePAEffect2')
data = []
for rel_path in os.listdir(MEASURE_FOLDER):
    run_path = os.path.join(MEASURE_FOLDER, rel_path)
    filename = os.path.join(run_path, 'data.csv')
    settingsname = os.path.join(run_path, 'Settings.txt')
    try:
        dh1 = MTdataHost(SAMPLE_RATE)
        dh1.loadCATdata(fileName=filename, settingsName=settingsname)
        dh1.timeDeload=0
        dh1.timeReload=0
        dh1.setCATtiming()
        dh1.tLoad = dh1.tLoad - dh1.timeBaseline
        dh1.tBaseline = dh1.tBaseline - dh1.timeBaseline
        dh1.setBaseline(0.002)
        dh1.setLoading(0.002)
        initFit, initX = dh1.setInitialLoad(0.01)

        ind1 = int(dh1.initTime[0]*2000)
        ind2 = ind1 + len(dh1.initTime)
        plt.plot(dh1.initTime, dh1.voltage[ind1:ind2+1][:len(dh1.initTime)])
        plt.plot(dh1.initTime, initFit[2])
        plt.title(f'Loading Rate = {dh1.initMOTR:.2e},  MOT SS = {dh1.motSS:.2e}')
        plt.show()
        plt.close()
        data.append({'R':dh1.initMOTR, 'MOTSS':dh1.motSS, 'Gamma':dh1.motR})
    except Exception:
        pass
data = pd.DataFrame(data)
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
index 0 is out of bounds for axis 0 with size 0
Exception in setLoading :(
In [ ]:
data
Out[ ]:
R MOTSS Gamma
0 0.019687 0.142943 0.138208
1 0.018433 0.160811 0.114580
2 0.018179 0.172178 0.117944
3 0.018500 0.146471 0.145065
4 0.010104 0.072018 0.155786
5 0.008487 0.101331 0.097917
6 0.009577 0.081486 0.136252
In [ ]:
MEASURE_FOLDER = os.path.join(EXP_FOLDER, 'varPAGranularOct5')
df = get_data_frame(MEASURE_FOLDER,
                    plot=False,
                    cache_all=True)
df.drop(columns=['betaPAErr'], inplace=True)
df.dropna(inplace=True)
df = df[df['ratio']<1.2]

groupbyKey = 'pump_reference'
titleKey = 'pump_AOM_freq'

df_grouped = df.groupby(by=groupbyKey)
min_ratios = df_grouped['ratio'].min()

groups = dict(list(df_grouped))
dfs = [df for df in groups.values()]

# plotting ratio vs freq
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
# x = [df[groupbyKey].mean() for df in dfs]
# y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
# plt.plot( x, y ,'-o')
# plt.xlabel(groupbyKey)
# plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
# plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
# plt.show()
# plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
# plt.close()

#---------------------------------------------------

for i, df  in enumerate(dfs[:]):
    data = df
    freqs = ((max_freqs[0]-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
100%|██████████| 331/331 [03:39<00:00,  1.51it/s]
In [ ]:
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))[1:]
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
# x = [df[groupbyKey].mean() for df in dfs]
# y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
# plt.plot( x, y ,'-o')
# plt.xlabel(groupbyKey)
# plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
# plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
# plt.show()
# plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
# plt.close()

#---------------------------------------------------

for i, df  in enumerate(dfs[:]):
    data = df
    freqs = ((max_freqs[0]-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
In [ ]:
dfs = dfs[1:]
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
# x = [df[groupbyKey].mean() for df in dfs]
# y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
# plt.plot( x, y ,'-o')
# plt.xlabel(groupbyKey)
# plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
# plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
# plt.show()
# plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
# plt.close()

#---------------------------------------------------

for i, df  in enumerate(dfs[:]):
    data = df
    freqs = ((max_freqs[0]-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
In [ ]:
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[::2]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
# x = [df[groupbyKey].mean() for df in dfs]
# y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
# plt.plot( x, y ,'-o')
# plt.xlabel(groupbyKey)
# plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
# plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
# plt.show()
# plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
# plt.close()

#---------------------------------------------------

for i, df  in enumerate(dfs[::2]):
    data = df
    freqs = ((max_freqs[0]-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()
In [ ]:
dfs = dfs[2:]
max_freqs = [384182.5]*len(dfs)
zipped_data = list(zip(dfs, max_freqs))
fig, ax = plt.subplots()
for i, (df, max_freq)  in enumerate(zipped_data[:]):
    data = df
    freqs = ((max_freq-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    ax=plot_spline_fit(ax, x=freqs, y=data['ratio'], yerr=data['ratioErr'],scolor=f'C{i}', mfc=f'C{i}',color=f'C{i}', s=0.0, ms=5, figsize=(10, 10), label=f"{groupbyKey} = { data.iloc[10][groupbyKey] :.2f}", linewidth=2.5)

plt.legend()
plt.savefig(os.path.join(MEASURE_FOLDER, 'lossFeatures.png'))
plt.title(f'Loss Features, {titleKey} = {data[titleKey].mean():.2f}', **titledict)
plt.show()
plt.close()
#---------------------------------------------------
# x = [df[groupbyKey].mean() for df in dfs]
# y = [(df['ratio'].max() - df['ratio'].min()) for df in dfs]
# plt.plot( x, y ,'-o')
# plt.xlabel(groupbyKey)
# plt.ylabel(r'SNR $ = V_{ss, off} - V_{ss, on}$ ')
# plt.title(f'SNR Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict)
# plt.show()
# plt.savefig(join(MEASURE_FOLDER, 'SNRplot.png'), dpi=200)
# plt.close()

#---------------------------------------------------

for i, df  in enumerate(dfs[:]):
    data = df
    freqs = ((max_freqs[0]-PUMP_FREQUENCY)-(data['tempV']-data['tempV'].min())*FREQVSVOLT- (data['currV']-data['currV'].min())*FREQVSCURR)
    betaPAs = [a for a,b in sorted(zip(data['betaPA'], freqs), key=lambda pair:pair[1])]
    freqs = sorted(freqs)
    plt.plot(freqs, betaPAs, 'o-', ms=5, label=f"{groupbyKey}={data.iloc[10][groupbyKey]:.2f}")
plt.legend()
plt.xlabel(r'$\Delta$ (GHz)')
plt.ylabel(r'$\beta_{\mathrm{eff}}$ ')
plt.savefig(join(MEASURE_FOLDER, 'betaVsFreq.png'), dpi=200) 
plt.title(f'2-body Decay Plot, {titleKey} = {df[titleKey].mean():.2f}', **titledict) 
plt.show()
plt.close()